#ifndef _CINDICATOR_MACD_H
#define _CINDICATOR_MACD_H

namespace GSTrader
{
	namespace Indicator
	{
		class INDICATOR_API MACD : public CIndicator
		{
		public:
			MACD();
			virtual ~MACD();
			virtual CIndicator* CreateInstance();

			void SetParam(int P, int S, int M, int nBarType);

			virtual void SetParam(double* pdParam);
			virtual void SetInputSeries(CSeries* pSeries);
			virtual void RefreshData();
			virtual double Calculate(int nIndex);

		private:
			EMA* m_pEMAFast;
			EMA* m_pEMASlow;
			EMA* m_pEMADea;

			CIndicatorResult* m_pDiff;
			CIndicatorResult* m_pDea;
			CIndicatorResult* m_pMACD;

			int m_p;
			int m_s;
			int m_m;

			int m_barType;

		};
	}
}

#endif 